package sdkshell.kuaiyan.com.kuaiyansdk.http;

import android.content.Context;


/**
 * Created by Max on 2016/6/23.
 */
public class NetApi<T extends Net> {
    private  Net netProxy;
    private Net okNetHttp;
    public static NetApi api;
    private Context context;
    private NetApi(Context context){
        this.context = context;
    }
    public static <T extends Net> Net getNetProxyInstance(Context context, T... t){
        NetApi api = new NetApi(context);
        api.netProxy =  api.getNet(t);
        return api.netProxy;
    }

    public Net getNet(T... t){
        if(t == null||t.length == 0) {
            okNetHttp = NetHttp.getNewInstance(context);
        }else{
            okNetHttp = t[0];
        }
        return okNetHttp;
    }
}
